class Subgroup < ActiveRecord::Base
  belongs_to :share
  has_many :operations

  def self.init
    res = self.new
    res.quantity = 0
    res.outcome = 0
    res.brokerage = 0
    res.income = 0
    res.balance = 0
    res
  end


  def self.listOpen
    find(:all,
         :conditions => "quantity > 0")
  end


  def averagePurchasePrice
    0
  end

  def averageSalePrice
    0
  end

end
